package database;

import Other.Glob;
import enums.SearchType;

public class MyDestination extends NewTirDataBase {

	String destinationID;
	String name;
	String codeCountryID;
	String countryName;
	
	private static final int DESTINATION_ID = 0;
	private static final int NAME = 1;
	private static final int CODE_COUNTRY_ID = 2;

	
	String[] data;
	
	public MyDestination(){
		
	}
	
	public MyDestination(String[] data){
		
		super();
		this.destinationID = data[DESTINATION_ID];
		this.name = data[NAME];
		this.codeCountryID = data[CODE_COUNTRY_ID];
		
		countryName ="";
		
		Glob.type = SearchType.COUNTRY;
		for (NewTirDataBase c : DatabaseExtension.getTableID("Select * from country")) {
			if (((MyCountry) c).getCountryID().trim().replaceAll("\n", "").equals(codeCountryID)) {
				//System.out.println("This is the country ID inside MyAddressee constructor " + ((MyCountry) c).getCountryID().trim().replaceAll("\n", ""));
				countryName = String.format("%s",((MyCountry) c).getCountryName());
				
			}
		
	}
		Glob.type = SearchType.DESTINATION;

}

	public String getDestinationID() {
		return destinationID;
	}

	public void setDestinationID(String destinationID) {
		this.destinationID = destinationID;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getCodeCountryID() {
		return codeCountryID;
	}

	public void setCodeCountryID(String codeCountryID) {
		this.codeCountryID = codeCountryID;
	}

	public String getCountryName() {
		return countryName;
	}

	public void setCountryName(String countryName) {
		this.countryName = countryName;
	}
	
	
	
	
}